package com.rtx.edi.platform.source.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rtx.edi.platform.source.bean.PlExpressSourceDetail;
import com.rtx.edi.platform.source.mapper.PlExpressSourceDetailMapper;
import com.rtx.edi.platform.source.service.PlExpressSourceDetailService;

@Service
public class PlExpressSourceDetailServiceImpl extends ServiceImpl<PlExpressSourceDetailMapper, PlExpressSourceDetail> implements PlExpressSourceDetailService{

	@Override
	public void selectList(Page<PlExpressSourceDetail> pageParam, PlExpressSourceDetail po) {
        LambdaQueryWrapper<PlExpressSourceDetail> query = Wrappers.lambdaQuery();
        query.eq(PlExpressSourceDetail::getExpresssourceid, po.getExpresssourceid());
        query.eq(po.getName() != null,PlExpressSourceDetail::getName, po.getName())
                .like(po.getCode() != null, PlExpressSourceDetail::getCode, po.getCode());
        baseMapper.selectPage(pageParam,query);
	}

	@Override
	public void addData(String datasourckey, PlExpressSourceDetail dto) {
		baseMapper.insert(dto);
	}
}
